<<<<<<< .mine
function Funct(num,str){
               
    this.change = change;  
    function change(num,str){
        this.num = num;
        this.str= str;            
    }
    this.change(num, str); 
        
    
}
         
         
function MyButton(myFunct,funct,functions,y){
    Sprite.apply(this);
                 
    this.myFunct = myFunct;
    this.funct = funct;
    this.functions = functions;
    this.b = new Button(this.myFunct.str);
    this.b.t.text = this.myFunct.str; 
    this.b.x =MainContainerWidth/2 + MainContainerHeight/2;
    this.b.y = MainContainerHeight/2 + y;
    this.b.addEventListener(MouseEvent.CLICK, onCL);
    this.addChild( this.b);  
                
    function onCL(e) {
                  
        var parent = e.target.parent;
               
        var newNum= (parent.myFunct.num + 1) % 3; 
                      
        parent.myFunct.change(newNum, parent.functions.playgroundArray[newNum]);
        parent.b.t.text = parent.myFunct.str;
        newNum = newNum+(parent.funct.num + 2*newNum);
        parent.functions.num = newNum;
        const IMAGE_URL= Game.picturesPath+ "levels/levelFunctions/funct"+ newNum +".png"; 
        var btMap = parent.functions.picture;
        btMap = Game._game.bitmaps[IMAGE_URL];
        btMap.scaleX = btMap.scaleY = 0.9;
        var x = MainContainerWidth/2 - MainContainerHeight/2;
        var y = MainContainerHeight/2 - MainContainerHeight/2;
        btMap.x = x;
        btMap.y = y;     
        parent.functions.addChild(btMap);
        console.debug(solved);
                    
        parent.functions.check(parent);
    }  
                
}
            
MyButton.prototype = new Sprite();
            
 

function Functions(x,y){   
    Sprite.apply(this);
    this.playgroundArray = ["sin(x)","cos(x)","  x^2 "];                     
    this.f = new Funct(1,this.playgroundArray[1]);
    this.g = new Funct(1,this.playgroundArray[1]);
    this.bf = new MyButton(this.f, this.g, this,-100);
    this.bg = new MyButton(this.g, this.f, this,0);
    this.addChild(this.bf);
    this.addChild(this.bg);
    this.num =0;
   
    this.show = show;
    function show(){  
                                 
              
                  
                    
        this.begin = new Sprite();		
        this.begin.graphics.beginFill(black);
        this.begin.graphics.drawRect(x-10,y+MainContainerHeight*0.9/2-5, 10, 10);
        this.begin.visible = true;
        this.addChild(this.begin);
        this.end = new Sprite();		
        this.end.graphics.beginFill(black);
        this.end.graphics.drawRect(x+MainContainerHeight*0.9,y+MainContainerHeight*0.9/2 - 9.5*10, 10, 10);
        this.end.visible = true;
        this.addChild(this.end);
                    
                    
        this.num = this.f.num+(this.g.num+2*this.f.num);

        const IMAGE_URL= Game.picturesPath+ "levels/levelFunctions/funct"+ this.num  +".png";
        this.picture = Game._game.bitmaps[IMAGE_URL];
        this.picture.scaleX = this.picture.scaleY = 0.9;
        this.picture.x = x;
        this.picture.y = y;        
        this.addChild(this.picture); 
    }
                
    this.check = check;
    function check(parent){
        if(this.num == 6 || this.num == 0){
            solved = true;
            var toto = parent.parent.parent;
            toto.levelSolved();
            toto.timer.TimerStop();
        }  
                    
    }
             
}
Functions.prototype = new Sprite();=======
function Funct(num,str){
               
    this.change = change;  
    function change(num,str){
        this.num = num;
        this.str= str;            
    }
    this.change(num, str); 
        
    
}
         
         
function MyButton(myFunct,funct,functions,y){
    Sprite.apply(this);
                 
    this.myFunct = myFunct;
    this.funct = funct;
    this.functions = functions;
    this.b = new Button(this.myFunct.str);
    this.b.t.text = this.myFunct.str; 
    this.b.x =cwidth/2 + size/2;
    this.b.y = cheight/2 + y;
    this.b.addEventListener(MouseEvent.CLICK, onCL);
    this.addChild( this.b);  
                
    function onCL(e) {
                  
        var parent = e.target.parent;
               
        var newNum= (parent.myFunct.num + 1) % 3; 
                      
        parent.myFunct.change(newNum, parent.functions.playgroundArray[newNum]);
        parent.b.t.text = parent.myFunct.str;
        newNum = newNum+(parent.funct.num + 2*newNum);
        parent.functions.num = newNum;
        const IMAGE_URL= "pictures/funct"+ newNum +".png"; 
                  
        var btMap = parent.functions.picture;
        var bitmapData = new BitmapData(IMAGE_URL);
        btMap = new Bitmap(bitmapData);
        btMap.scaleX = btMap.scaleY = 0.9;
        var x = cwidth/2 - size/2;
        var y = cheight/2 - size/2;
        btMap.x = x;
        btMap.y = y;     
        parent.functions.addChild(btMap);
        console.debug(solved);
                    
        parent.functions.check(parent);
    }  
                
}
            
MyButton.prototype = new Sprite();
            
 

function Functions(x,y){   
    Sprite.apply(this);
    this.playgroundArray = ["sin(x)","cos(x)","  x^2 "];                     
    this.f = new Funct(1,this.playgroundArray[1]);
    this.g = new Funct(1,this.playgroundArray[1]);
    this.bf = new MyButton(this.f, this.g, this,-100);
    this.bg = new MyButton(this.g, this.f, this,0);
    this.addChild(this.bf);
    this.addChild(this.bg);
    this.num =0;
   
    this.show = show;
    function show(){  
                                 
              
                  
                    
        this.begin = new Sprite();		
        this.begin.graphics.beginFill(black);
        this.begin.graphics.drawRect(x-10,y+size*0.9/2-5, 10, 10);
        this.begin.visible = true;
        this.addChild(this.begin);
        this.end = new Sprite();		
        this.end.graphics.beginFill(black);
        this.end.graphics.drawRect(x+size*0.9,y+size*0.9/2 - 9.5*10, 10, 10);
        this.end.visible = true;
        this.addChild(this.end);
                    
                    
        this.num = this.f.num+(this.g.num+2*this.f.num);

        const IMAGE_URL= "pictures/funct"+ this.num +".png";  
        var bitmapData = new BitmapData(IMAGE_URL);
        this.picture = new Bitmap(bitmapData);
        this.picture.scaleX = this.picture.scaleY = 0.9;
        this.picture.x = x;
        this.picture.y = y;        
        this.addChild(this.picture); 
    }
                
    this.check = check;
    function check(parent){
        if(this.num == 6 || this.num == 0){
            solved = true;
            var toto = parent.parent.parent;
            toto.levelSolved();          
        }  
                    
    }
             
}
Functions.prototype = new Sprite();>>>>>>> .r36
